package com.sharemarking.application.wechat.service;

import com.sharemarking.application.common.api.ResponseParams;
import com.sharemarking.application.common.utils.WechatSignUtil;
import com.sharemarking.application.wechat.dto.SignDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.sql.SQLException;
import java.util.Map;

/**
 * Created by Administrator on 2017/9/8.
 */
@Service
public class RecordService {

    @Autowired
    WechatSignUtil signUtil;

    public ResponseParams sign(HttpServletRequest request) throws SQLException {
        ResponseParams responseParams = new ResponseParams();
        String url = request.getParameter("url");
        SignDto signDto = signUtil.sign(url);

        responseParams.getData().put("signDto", signDto);
        return responseParams;
    }
}
